<template>
  <div class="box">
<!--    <router-link :to="route.path" v-for="route in routes">{{ route.name }}</router-link>-->
    <div  v-for="route in routes">
      <a v-if="route.name!=null && route.name!==''" @click="$router.push({name:route.name})">{{ route.name }} </a>
    </div>
  </div>
  运行环境：{{ ENV }}
</template>

<script setup>
import {getCurrentInstance, onMounted, onUnmounted, reactive, watch, ref, computed} from 'vue'
import {useRouter, useRoute} from 'vue-router'

const router = useRouter()
const proxy = getCurrentInstance()
const route = useRoute()

const ENV = import.meta.env.VITE_APP_ENV
const routes = computed(() => router.options.routes)

onMounted(() => {
  console.log(proxy)
  console.log(routes)

  console.log(new Date().getMonth())
  let month = 6
  console.log(month < 3 ? 0 : month < 6 ? 1 : month < 9 ? 2 : 3)
})

</script>

<style lang="scss" scoped>
.box {
  display: flex;
  width: 100%;

  a {
    display: inline-block;
    padding: 10px;

    &:hover {
      background-color: #e5e5f4;
      border: 1px solid #8f8ff4;
    }
  }

}
</style>
